const path = require('path')

function resolve(dir) {
	return path.join(__dirname, dir)
}

module.exports = {
	//关闭eslint
	lintOnSave: false,
	publicPath: "./",
	productionSourceMap: false, // 生产环境是否生成 sourceMap 文件
	chainWebpack: (config) => {
		config.resolve.alias.set('@/', resolve('src'))
	},

	css: {
		loaderOptions: {
			less: {
				modifyVars: {},
				javascriptEnabled: true,
			}
		}
	},
	devServer: {
		port: 3000,
		proxy: {
			'/api': {
				target: process.env.VUE_APP_SERVER_URL,
				changeOrigin: true,
				pathRewrite: {
					'^/api': ''
				}
			},
		}
	}
}
